import request from '@/utils/request';

export async function GetUserByPage(params: any) {
  return request('/api/system/getUserByPage', {
    method: 'POST',
    data: params,
  });
}

export async function AddUser(params: any) {
  return request('/api/system/addUser', {
    method: 'POST',
    data: params,
  });
}

export async function updateUser(params: any) {
  return request('/api/system/updateUser', {
    method: 'POST',
    data: params,
  });
}

export async function DelUser(params: any) {
  return request('/api/system/delUser', {
    method: 'POST',
    data: params,
  });
}

export async function LockUser(params: any) {
  return request('/api/system/lockUser', {
    method: 'POST',
    data: params,
  });
}

export async function loadTransferUserRelRoler(params: any) {
  return request('/api/system/loadTransferUserRelRole', {
    method: 'POST',
    data: params,
  });
}

export async function saveRolesByUserId(params: any) {
  return request('/api/system/saveRolesByUserId', {
    method: 'POST',
    data: params,
  });
}

/**
 *
 * @param params
 * @returns
 */
export async function updatePassword(params: any) {
  return request('/api/system/updatePassword', {
    method: 'POST',
    data: params,
  });
}

export async function uploadAvatar(params: any) {
  return request('/api/system/uploadAvatar', {
    method: 'POST',
    requestType: 'form',
    data: params,
  });
}

export async function ReLogin(params: any) {
  console.log('Simple====');
  return request('/api/system/reLoin', {
    method: 'POST',
    data: params,
  });
}

export async function GetUserInfo() {
  return request('/api/user/viewBaseInfo', {
    method: 'POST',
    // data: params,
  });
}
